package org.linuxsogood.boot.service;

import org.linuxsogood.boot.mapper.BlogMapper;
import org.linuxsogood.boot.pojo.Blog;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

/**
 * @author honway.liu
 * @date 2018/8/5 下午9:17
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
@Service
public class BlogService {

    private final BlogMapper blogMapper;

    public BlogService(BlogMapper blogMapper) {
        this.blogMapper = blogMapper;
    }

    public Blog selectBlogByPrimiary(Integer id) {
        Assert.notNull(id, "id不能为空.");
        return blogMapper.selectById(id);
    }

}
